- /* sdfatant.cpp by K.Tsuru */
- // function ID = 3602 DARDIX
- /**************************************************
- SDouble class
- inverse trigonometric function arctan x
- using an addition theorem
- arctan(x) = arctan(y) + arctan{(x-y)/(1+x*y)}.
- For the algorithm see Asin().It is faster than AtanA(x)
- a little.The the conditions |x| << 1.0 and |x| >> 1.0
- are not checked.They are done in Atan().
- **************************************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
- static void AtanTApproX(const SDouble& x, SDouble& approX){
- SDouble y;
- y = Tan(approX); // fastest function TanBS() is used version 2.21. See "snmath.h"
- y = (x - y)/(1.0 + x*y);
- approX += AtanSeries(y, approX.RdxExp());
- }
- SDouble AtanT(const SDouble& x){
- RealSize C;
- SDouble r;
- // Oct 19, 2000 Change here.
- // exclude "const" since 2.191 for the error of bcc55 E2015
- uint ef = x.EffFig(), fig = (ef >= 2048u) ? 125u : 25u;
- double dblX = doubleD(x);
- //An intermediate step is inserted.
- C.SetEffFig(min(fig, ef));
- r = atan(dblX);
- AtanTApproX(x, r);
- C.SetEffFig(0);
-
- if( x.EffFig() > fig ) AtanTApproX(x, r); //full precision
- return r;
- }
sdfatant.cpp : last modifiled at 2015/12/03 21:32:55(1,169 bytes)
created at 2017/10/07 10:22:50
The creation time of this html file is 2017/10/07 11:29:39 (Sat Oct 07 11:29:39 2017).